package javabase.desginpattern.behavior.handlerchain;

/**
 * 系主任
 * @author fance
 * @date 18-4-26 下午2:58
 */
public class DepartmentHead extends Leader{
    public DepartmentHead(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveNode leaveNode) {
        if (leaveNode.getDays() <= 7) { // 小于7 天 可审批
            System.out.println("系主任: " + name + "审批 " + leaveNode.getName()
                    + "同学请假 " + leaveNode.getDays() + " 天");
        } else {
            if (this.successor != null) {
                this.successor.handleRequest(leaveNode);
            }
        }
    }
}
